<?php
/**
 * 后台操作日志模型
 * @author yupoxiong<i@yufuping.com>
 */

namespace app\admin\model;

class Ota extends Model
{
    protected $name = 'ota';

    public $softDelete = false;

    public $methodText = [
        1 => 'GET',
        2 => 'POST',
        3 => 'PUT',
        4 => 'DELETE',
    ];

    protected $autoWriteTimestamp = true;
    protected $updateTime = false;

    protected $searchField = [
        'ota_name',
        'ota_group'
    ];

    protected $timeField = [
        'create_time'
    ];


    //关联分组
    public function OtaGroup()
    {
        return $this->hasMany(OtaGroup::class, 'id', 'ota_group');
    }

    //关联用户
    public function OtaUser()
    {
        return $this->hasMany(OtaUser::class, 'account', 'ota_account');
    }
}

